#pragma once
#include <string>
#include <mc/network/MinecraftPackets.h>
#include <mc/network/packet/TextPacket.h>
#include <mc/network/packet/BossEventPacket.h>
#include <mc/server/commands/CommandVersion.h>
#include <mc/network/ServerNetworkHandler.h>
#include <mc/network/packet/CommandRequestPacket.h>
#include <mc/server/commands/CommandContext.h>
#include <mc/server/commands/PlayerCommandOrigin.h>
#include <mc/server/commands/MinecraftCommands.h>
#include <mc/server/commands/ServerCommandOrigin.h>
#include <mc/world/Minecraft.h>
#include <mc/world/level/Level.h>
#include <ll/api/service/Service.h>
#include <ll/api/service/Bedrock.h>



using namespace std;

namespace XPacket {

    template <typename T, uintptr_t off>
    inline T& dAccess(void* ptr) {
        return *(T*)(((uintptr_t)ptr) + off);
    }
    template <typename T, uintptr_t off>
    inline T const& dAccess(void const* ptr) {
        return *(T*)(((uintptr_t)ptr) + off);
    }
    template <typename T>
    inline T& dAccess(void* ptr, uintptr_t off) {
        return *(T*)(((uintptr_t)ptr) + off);
    }
    template <typename T>
    inline const T& dAccess(void const* ptr, uintptr_t off) {
        return *(T*)(((uintptr_t)ptr) + off);
    }

    bool playerRunCommand(Player& player, const string& cmd);
    bool runCommand(const string& cmd);
}